﻿using ConfExpert.Forms.Base;
using ConfExpert.Utility;
using DevTeam;
using System;
using System.Data;

namespace ConfExpert.Forms.Depo._7C
{
    public partial class IntegrityCheck : XForm
    {
        int CKBatchId = -1;
        public IntegrityCheck(int ckBatchId)
        {
            InitializeComponent();
            TAM.GPgrnTableAdapter = new Datasets.MyDataTableAdapters.GPgrnTableAdapter();
            
            this.CKBatchId = ckBatchId;
            this.Text += "- " + AppSession.Lookups.CKBatch.FindByCKBatchId(CKBatchId).Notes;
        }

        private void IntegrityCheck_Load(object sender, EventArgs e)
        {
            

            DataSet ds = ExecuteDataSet("CheckGPOrder", CKBatchId);
            gvOA.Init(ds.Tables[0]);
            gvAG.Init(ds.Tables[1]);
            gvAGpos.Init(ds.Tables[2]);
            gvOG.Init(ds.Tables[3]);
            gvEksikReferans.Init(ds.Tables[4]);

            gvOA.AddSummary();
            gvOA.BestFitColumns();

            gvAG.AddSummary();
            gvAG.BestFitColumns();

            gvAGpos.AddSummary();
            gvAGpos.BestFitColumns();

            gvOG.AddSummary();
            gvOG.BestFitColumns();

            gvEksikReferans.AddSummary();
            gvEksikReferans.BestFitColumns();
        }

    }
}
